package com.tuanbiao.controllers;

import android.view.KeyEvent;

import com.hzjq.data.entity.PmEntity;
import com.hzjq.data.hzjq.entity.CapRecordEntity;
import com.hzjq.data.minbao.entity.AuthEntity;
import com.hzjq.lib.bean.PlanInfo;
import com.hzjq.lib.cap.bean.ScanResult;
import com.tuanbiao.base.mvp.IModel;
import com.tuanbiao.base.mvp.IPresenter;
import com.tuanbiao.base.mvp.IView;
import com.tuanbiao.models.action.AuthAction;
import com.tuanbiao.models.action.DetonatorAction;
import com.tuanbiao.models.action.LocationAction;
import com.tuanbiao.models.action.ProjectAction;
import com.tuanbiao.models.action.SettingAction;

import java.io.File;
import java.util.List;

/**
 * @author abiao
 * @since 2022/4/22 15:52
 */
public interface AuthController {
    interface Model extends IModel, AuthAction, DetonatorAction, ProjectAction, LocationAction, SettingAction {

    }

    interface View extends IView {

    }

    interface Presenter extends IPresenter {

    }


    interface OnlineView extends IView {
        void showProject(PmEntity currentProject);

        void setDetonatorItems(List<CapRecordEntity> entities);
    }

    interface OnlinePresenter extends IPresenter {

        void downloadWorkCode(List<CapRecordEntity> entities);

    }


    interface SequenceView extends IView {

    }

    interface SequencePresenter extends IPresenter {
        void downloadAuthFile(String string);
    }


    interface OfflineView extends IView {

        void setItems(List<AuthEntity.Lgs.Lg> lgs);

        void showRepeatDialog(int repeatCount);

        void addDetonators(List<AuthEntity.Lgs.Lg> newCaps);

        void addDetonators(AuthEntity.Lgs.Lg newCaps);

        void showUidError(long uidErrorCount);

        void showStatistics(PlanInfo planInfo);

        void showScanRepeat(Object o, ScanResult scanResult);

        void onScannerTypeChange(boolean isScanner);

        void scrollToPosition(String uid);
    }

    interface OfflinePresenter extends IPresenter {
        void menuReadOnline(int count);

        void menuInsertDetonator(String uid);

        void menuInsertDetonator(String startUid, String endUid);

        long getMaxDelay();

        void downloadAuthFile(List<AuthEntity.Lgs.Lg> lgs);

        void downloadAuthFile(String code, String startCode, String count);

        boolean onKeyDown(int keyCode, KeyEvent event);
    }

    interface LocalView extends IView {
        void setItems(List<File> files);
    }

    interface LocalPresenter extends IPresenter {
        void refresh();

        void getAuthFile(File path, String password);
    }

    interface ListView extends IView {

        void setItems(List<AuthEntity> entities);

        void addItems(List<AuthEntity> entities);
    }

    interface ListPresenter extends IPresenter {

        void refresh();

        void loadMore();

        void deleteAuth(AuthEntity entity);
    }

    interface DetailsView extends IView {
        void showDetails(AuthEntity entity);
    }

    interface DetailsPresenter extends IPresenter {

    }
}
